package edu.spec.teacher.model;

import edu.spec.sys.model.User;
import edu.spec.sys.model.enumeration.YesNo;

import javax.persistence.*;
import java.util.Date;

/**
 * Author       : MadFrog
 * Date         : 2018/10/5 16:51
 * Description  : 选票
 */
@Entity
@Table(name = "t_vote")
public class Vote {
    private Integer id;
    private User user;
    private Elect elect;
    private String result;
    private YesNo valid;
    private Date FinishDate;

    public Vote() {
    }

    @Id
    @GeneratedValue
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name = "user_id")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    @ManyToOne
    @JoinColumn(name = "elect_id")
    public Elect getElect() {
        return elect;
    }

    public void setElect(Elect elect) {
        this.elect = elect;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public YesNo getValid() {
        return valid;
    }

    public void setValid(YesNo valid) {
        this.valid = valid;
    }

    public Date getFinishDate() {
        return FinishDate;
    }

    public void setFinishDate(Date finishDate) {
        FinishDate = finishDate;
    }
}
